﻿namespace FFF.Test.Application.Repositories.FW
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;
    using Abp.Application.Services.Dto;
    using Abp.AutoMapper;
    using FFF.Test.Entity.FW;
    using FFF.Test.Entity.FW.View;

    /// <summary>
    /// 1.003 用户登录(于大明)输入dto
    /// </summary>
    public class UserLoginInDto
    {
        /// <summary>
        /// 用户名称
        /// </summary>
        [Required(ErrorMessage = "用户名称不能为空")]
        public string UserName { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [Required(ErrorMessage = "密码不能为空")]
        public string Password { get; set; }

        /// <summary>
        /// 验证码
        /// </summary>
        public string VerificationCode { get; set; }
    }

    /// <summary>
    /// 1.003 用户登录(于大明)输出dto
    /// </summary>
    [AutoMapFrom(typeof(ViewFWUser))]
    public class UserLoginOutDto
    {
        /// <summary>
        /// 用户输出dto
        /// </summary>
        public UserLoginDto LoginDto { get; set; }

        /// <summary>
        /// 是否需要展示验证码
        /// </summary>
        public bool IsNeedValidateCode { get; set; }

        /// <summary>
        /// 错误信息
        /// </summary>
        public string ErrorMsg { get; set; }
    }

    /// <summary>
    /// 用户登陆成功输出的dto
    /// </summary>
    [AutoMapFrom(typeof(ViewFWUser))]
    public class UserLoginDto
    {
        /// <summary>
        /// 用户GUID
        /// </summary>
        [Display(Name = "用户GUID", Description = "用户GUID")]
        [Column("UserGUID")]
        public Guid Id { get; set; }

        /// <summary>
        /// 用户编码
        /// </summary>
        [Display(Name = "用户编码", Description = "用户编码")]
        [Column("UserCode")]
        [StringLength(256)]
        public string UserCode { get; set; }

        /// <summary>
        /// 用户名称
        /// </summary>
        [Display(Name = "用户名称", Description = "用户名称")]
        [Column("UserName")]
        [StringLength(256)]
        public string UserName { get; set; }

        /// <summary>
        /// 公司GUID
        /// </summary>
        [Display(Name = "公司GUID", Description = "公司GUID")]
        [Column("BuUnitGUID")]
        public Guid? BuUnitGUID { get; set; }

        /// <summary>
        /// 用户图像url(上传图片)
        /// </summary>
        [Display(Name = "用户图像url(上传图片)", Description = "用户图像url(上传图片)")]
        [Column("UserImageUrl")]
        [StringLength(512)]
        public string UserImageUrl { get; set; }

        /// <summary>
        /// 默认公司GUID
        /// </summary>
        [Display(Name = "默认公司GUID", Description = "默认公司GUID")]
        [Column("DefaultBuUnitGUID")]
        public Guid? DefaultBuUnitGUID { get; set; }

        /// <summary>
        /// 默认系统GUID
        /// </summary>
        [Display(Name = "默认系统GUID", Description = "默认系统GUID")]
        [Column("DefaultApplicationGUID")]
        public Guid? DefaultApplicationGUID { get; set; }

        /// <summary>
        /// 用户密码加密字符串
        /// </summary>
        public string UserPwdEncry { get; set; }

        /// <summary>
        /// Gets or sets the tokne.
        /// </summary>
        /// <value>The tokne.</value>
        /// <remarks>于大明</remarks>
        public string Tokne { get; set; }
    }
}
